/**
 * @file .
 * @author wangxiaowei0303@163.com
 * 当前项目中使用到的异常基类.
 */

#include "string_util.h"
#include "exception_util.h"

const char* 
Exception::what() const throw()
{
    return err_str_.data();
}

Exception::~Exception() throw() 
{
    ;
}

void throwException(const char *format,...)
{
    std::string str;
    va_list ap;
    va_start(ap,format);
    try {
        vaddFormat(str,format,ap);
    } catch (const std::exception &e) {
        va_end(ap);
        throw;
    }
    va_end(ap);
    throw Exception(str);
}

